Skip to content

Conversation

addaleax
Copy link
Collaborator

@addaleax addaleax commented Oct 7, 2025

No description provided.

@Copilot Copilot AI review requested due to automatic review settings October 7, 2025 15:09
@addaleax addaleax requested a review from a team as a code owner October 7, 2025 15:09
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Enable the new autocompleter by default (unless explicitly disabled via USE_NEW_AUTOCOMPLETE='0') and adjust test expectations accordingly. Some tests were globally skipped, and timing instrumentation was effectively disabled.

  • Default condition for enabling new autocompleter changed to env var !== '0'
  • Several test suites/contexts were skipped and test logic updated for new enablement semantics
  • Startup timing markTime implementation replaced with a no-op (previous logic commented out)

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/cli-repl/src/startup-timing.ts Replaced timing capture with no-op, leaving prior implementation commented
packages/cli-repl/src/mongosh-repl.ts Switched feature flag condition to enable new autocompleter unless set to '0'
packages/cli-repl/src/mongosh-repl.spec.ts Updated test conditions to reflect new default enablement logic
packages/cli-repl/src/cli-repl.spec.ts Adjusted autocomplete test logic and skipped a CTRL-C context
packages/cli-repl/src/async-repl.spec.ts Entire AsyncRepl test suite skipped
packages/browser-runtime-core/src/autocompleter/shell-api-autocompleter.ts Updated condition to initialize new autocompleter by default

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

let oldMongoshCompleter: (line: string) => Promise<CompletionResults>;

if (process.env.USE_NEW_AUTOCOMPLETE) {
if (process.env.USE_NEW_AUTOCOMPLETE !== '0') {
Copy link
Preview

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The magic string comparison !== '0' is repeated across multiple files; consider introducing a helper (e.g., function isNewAutocompleteEnabled(env = process.env) { return env.USE_NEW_AUTOCOMPLETE !== '0'; }) to centralize the flag semantics and avoid divergence.

Copilot uses AI. Check for mistakes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a horrible idea. If we had it centralized like that, it'd have made it easier to flip the flag.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we can still do this if you prefer? I think this is something that would primarily have made sense when we first introduced the flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants